package crawler.cnki.service.impl;

import crawler.cnki.entity.Researcher;
import crawler.cnki.service.ResearcherService;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ResearcherImpl implements ResearcherService {
    @Resource
    private MongoTemplate mongoTemplate;

    @Override
    public void save(Researcher researcher) {
        mongoTemplate.save(researcher);
    }

    @Override
    public List<Researcher> findAll() {
        return mongoTemplate.findAll(Researcher.class);
    }
}
